]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
tools/toolbox: Consistently handle option parsing failures
authorFlorian Müllner <fmuellner@gnome.org>
Fri, 12 Jan 2024 11:17:17 +0000 (12:17 +0100)
committerMarge Bot <marge-bot@gnome.org>
Mon, 15 Jan 2024 17:18:09 +0000 (17:18 +0000)
`getopt` already prints a message on parse errors, but it still
seems like good style to point to --help as we do elsewhere.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3113>

tools/toolbox/create-toolbox.sh
tools/toolbox/meson-build.sh

index ba240c537ceba758c81ce4bf6d8d78c8038c722d..5c06021e01c8f250692dacdb0c76b5fc10c54114 100755 (executable)
@@ -96,7 +96,7 @@ TEMP=$(getopt \
   --longoptions 'skip-mutter' \
   --longoptions 'set-default' \
   --longoptions 'help' \
-  -- "$@")
+  -- "$@") || die "Run $(basename $0) --help to see available options"
 
 eval set -- "$TEMP"
 unset TEMP
index 0f5923bb8a5f5e37a881dbd579526a20a36817ea..82234f1197c1cc61ffc8e5b0f061d041946bcadb 100755 (executable)
@@ -50,7 +50,7 @@ TEMP=$(getopt \
   --longoptions 'toolbox:' \
   --longoptions 'dist' \
   --longoptions 'help' \
-  -- "$@")
+  -- "$@") || die "Run $(basename $0) --help to see available options"
 
 eval set -- "$TEMP"
 unset TEMP